﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Exentials.Xoox.Spreadsheet
{
    public class XRow : XElementSequenceContainer<XCell>, ISequence
    {
        //3 <sequence>
        //4 <element name="c" type="CT_Cell" minOccurs="0" maxOccurs="unbounded"/>
        //5 <element name="extLst" minOccurs="0" type="CT_ExtensionList"/>
        //6 </sequence>
        //7 <attribute name="r" type="xsd:unsignedInt" use="optional"/>
        //8 <attribute name="spans" type="ST_CellSpans" use="optional"/>
        //9 <attribute name="s" type="xsd:unsignedInt" use="optional" default="0"/>
        //10 <attribute name="customFormat" type="xsd:boolean" use="optional" default="false"/>
        //11 <attribute name="ht" type="xsd:double" use="optional"/>
        //12 <attribute name="hidden" type="xsd:boolean" use="optional" default="false"/>
        //13 <attribute name="customHeight" type="xsd:boolean" use="optional" default="false"/>
        //14 <attribute name="outlineLevel" type="xsd:unsignedByte" use="optional" default="0"/>
        //15 <attribute name="collapsed" type="xsd:boolean" use="optional" default="false"/>
        //16 <attribute name="thickTop" type="xsd:boolean" use="optional" default="false"/>
        //17 <attribute name="thickBot" type="xsd:boolean" use="optional" default="false"/>
        //18 <attribute name="ph" type="xsd:boolean" use="optional" default="false"/>

        private XAttributeBase<int> _rowIndex;

        private XWorksheet _parent;

        public XRow()
            : base("row")
        {
            _rowIndex = new XAttributeBase<int>(this, "r");
        }

        public XWorksheet Worksheet
        {
            get { return _parent; }
            set { _parent = value; }
        }

        public int Index
        {
            get { return _rowIndex.Value; }
            set { _rowIndex.Value = value; }
        }

    }
}
